fix: Backspace/enter behaviour in empty block with children#2451
fix: Backspace/enter behaviour in empty block with children#2451matthewlipski merged 2 commits intomainfrom
Conversation
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
@blocknote/ariakit
@blocknote/code-block
@blocknote/core
@blocknote/mantine
@blocknote/react
@blocknote/server-util
@blocknote/shadcn
@blocknote/xl-ai
@blocknote/xl-docx-exporter
@blocknote/xl-email-exporter
@blocknote/xl-multi-column
@blocknote/xl-odt-exporter
@blocknote/xl-pdf-exporter
commit: |
|
@matthewlipski it's good that we don't lose content anymore, but in this case, I find the result unexpected, I would expect the item to preserve it's indentation not collapse because I removed the empty line |
nperez0111
left a comment
There was a problem hiding this comment.
Code seems fine, could do with some comments since this is a bit convoluted
Ah, so I do kind of agree but this is the same behaviour as Notion, so imo it's better to keep it the way it is: Screen.Recording.2026-02-17.at.16.57.40.mov |
|
It handles list items differently. So weird decision on their part, imo I would prefer what I'd described, but doesn't have to block this issue if you feel differently |
|
@nperez0111 could you show what you mean with list items being handled differently? It seems to work the same for all block types as far as I can tell, but I might be missing something Screen.Recording.2026-02-20.at.10.41.10.mov |
Screen.Recording.2026-02-20.at.10.54.29.movThis is what I mean |
|
Ok this is indeed a really weird choice from their side. I think for this PR, I'll keep the logic as is. If people end up filing issues that this is unexpected behaviour, changing it to preserve child block nesting should take not much effort. Will also add comments. |
|
Fine with me @matthewlipski |
Summary
There are currently 2 issues with backspace/enter handling in empty blocks with children:
Closes #1593
Rationale
This is a bug affecting core functionality.
Changes
Added handling for children in relevnt keyboard handlers.
Impact
N/A
Testing
Added e2e tests.
Screenshots/Video
Checklist
Additional Notes